import { HttpProvider } from './../http/http';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

/*
  Generated class for the BusiProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class BusiProvider {

  constructor(public http: HttpClient, private httpservice: HttpProvider) {
    console.log('Hello BusiProvider Provider');
  }



  getVersion() {
    let param = {
      "app": "hms_mobile"
    }
    return this.httpservice.postNoloading("version/getVersion", param);
  }
  register(body) {
    return this.httpservice.postLoading("parent/addParent", null, body);
  }

  //获取学院下拉列表
  getXueyuanList() {
    return this.httpservice.postLoading("dic/getDic?dicBh=XY");
  }
  //登录
  login(data) {
    return this.httpservice.postLoading("authen/getToken", null, data);
  }
  //所有教室预览
  getAllClassRoom() {
    return this.httpservice.postLoading("booked/getAllClassRoomInfo");
  }
  //获取空闲的教室
  getFreeClassRooom(param) {
    return this.httpservice.postLoading("booked/getFreeClassRoom", null, param);
  }
  //预定classroom
  bookClassRooom(param) {
    return this.httpservice.postLoading("booked/book", null, param);
  }

  //获取我都预定
  getMyBookedClassRoom() {
    return this.httpservice.postLoading("booked/getMyBookedClassRoom");
  }

  //获取临近结束的教室信息
  getCloseToEndBooking() {
    return this.httpservice.postNoloading("booked/getCloseToEndBooking");
  }
  closeNotice(bookedid){
    return this.httpservice.postNoloading("booked/closeNotice",{bookedid:bookedid});
  }
  //获取用户信息
  getUserInfo() {
    return this.httpservice.postNoloading("user/getUserinfo");
  }
  //修改密码
  passwordchange(passwordold, passwordnew) {
    let param = {
      "passwordold": passwordold,
      "passwordnew": passwordnew
    }
    return this.httpservice.postLoading("user/changeCurrentPassword", param);
  }

}
